/**
 *  
 */
package research.sbookmarking.input;

import java.util.*;
import research.sbookmarking.*;

//
/**
 * This is an abstract class. Each child is required to implement the {@link execute} method.  This class
 * conntains the command that will be executed against Connotea.org 
 * <p> 
 * @author <A HREF="mailto:aatleung@gmail.com">Albert Leung</a>
 * @version 1.0
 * 
 */
public abstract class Command {
	
	private DataContainer result = null;
	private String command = null;
	private List parameter = null;
	private String containerName = null;
	private String className = null;
	
	protected Command (String containerName, String className, 
					String command, List param){
		this.containerName = containerName;
		this.className = className;
		this.command = command;
		this.parameter = param; 
	}

	public String getClassName() {
		return this.className;
	}
	
	protected String getCommand() {
		return command;
	}
	
	protected List getParameter() {
		return parameter;
	}
	/**
	 * This method needs to be implement in its children.  This method contains the procedures
	 * required to query Connotea.org 
	 */
	public abstract void execute();
	
	/**
	 * This method is use to determine whether the data generate is for which {@link Container}.
	 * <p>
	 * @return whether this command contains data for the {@link GeneralContainer} 
	 * 		   or {@link SpecificContainer}. 
	 */
	protected String getContainerName(){
		return containerName;
	}

	/**
	 * Returns the results from the data query of Connotea.org
	 * @return a {@link DataContainer} that contains the data extracted from Connotea.org.
	 */
	public DataContainer getResult() {
		return result;
	}

	protected void setResult(DataContainer data) {
		this.result = data;
	}
}
